870c22
@@ -20,6 +20,7 @@
import java.net.URI;
 import java.util.Arrays;
 
 import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.util.ObjectHelper;
 
 public class IrcConfiguration implements Cloneable {
     private String target;
@@ -90,8 +91,15 @@
public class IrcConfiguration implements Cloneable {
             throw new RuntimeCamelException("The IRC channel name is required but not configured");
         }
 
-        setTarget("#" + uri.getFragment());
-    }
+        String channel = uri.getFragment();
+
+        if ( channel.contains("?")) {
+            //Need to strip off the query string from this fragment
+            channel = ObjectHelper.before(uri.getFragment(), "?");
+        }
+
+        setTarget("#" + channel);
+}
 
     public String getHostname() {
         return hostname;
